package com.lcb123.framework.repository;

import com.lcb123.framework.domain.User;
import java.util.Collection;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.rest.core.annotation.RestResource;

/**
 * 用户User CrudRepository定义
 *
 * @author lcb
 *
 */
@RestResource(exported = false) // 禁止暴露REST
public interface UserRepository extends CrudRepository<User,Long> {
    Collection<User> findAll();

    User findByUsername(String username);

    Page<User> findAll(Pageable p);

    Page<User> findByUsernameContaining(String searchPhrase, Pageable p);
}
